# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: Eric Bélanger <eric@archlinux.org>

_name=mutagen
pkgname=python-mutagen
pkgver=1.46.0
pkgrel=2
arch=(any)
pkgdesc="An audio metadata tag reader and writer (python library)"
url="https://github.com/quodlibet/mutagen"
license=(GPL2)
depends=(python)
makedepends=(python-build python-installer python-setuptools python-wheel)
checkdepends=(python-pytest python-hypothesis python-pyflakes
python-pycodestyle)
source=(https://github.com/quodlibet/$_name/releases/download/release-$pkgver/$_name-$pkgver.tar.gz{,.sig})
sha512sums=('52ab7408af46e54e79f1d157a3f6114e2606c6a55eb46fdd314dff82d6d586c2c22294b181a432581230dee566c79554456a9435a8e1188a91f4ae000644ae71'
            'SKIP')
b2sums=('44e0dbbc1c102521569a91386a9d807f3ad82ffb96a5e3f76958551d173d00c7095fa6a2668a0a418bfdda31be5c3bb175856b2278719007bf7af866c732dc40'
        'SKIP')
validpgpkeys=('0EBF782C5D53F7E5FB02A66746BD761F7A49B0EC') # Christoph Reiter <reiter.christoph@gmail.com>

build() {
  cd $_name-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -v --ignore tests/quality/test_flake8.py
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 {NEWS,README.rst} -t "$pkgdir/usr/share/doc/$pkgname/"
}
